package com.haier.npt.sso.domain;

import java.util.Collection;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.userdetails.UserDetails;

public class SysUserWapper  implements UserDetails {

	private static final long serialVersionUID = 1L;
	
	private Object user  ;  
	
	public Object getUser() {
		return user;
	}

	public SysUserWapper(Object user, String token) {
		super();
		this.user = user;
		this.token = token;
	}

	public void setUser(Object user) {
		this.user = user;
	}

	private String token ; 
	

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}
	
	
	public SysUserWapper(){
		super();
	}
	

	@Override
	public Collection<? extends GrantedAuthority> getAuthorities() {
		return AuthorityUtils.NO_AUTHORITIES;
	}

	@Override
	public boolean isAccountNonExpired() {
		return true;
	}

	@Override
	public boolean isAccountNonLocked() {
		return true;
	}

	@Override
	public boolean isCredentialsNonExpired() {
		return true;
	}

	@Override
	public boolean isEnabled() {
		return true;
	}

	@Override
	public String getPassword() {
		return  "N/A";
	}

	@Override
	public String getUsername() {
		return  this.token; 
	}
}
